import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/login/Login'
import Index from '@/components/index/Index'
import Search from '@/components/index/Search'
import Detail from '@/components/index/Detail'
import Comment from '@/components/template/Comment'
import Read from '@/components/index/Read'
import Manage from '@/components/manage/Manage'
import Profile from '@/components/manage/content/Profile'
import Collect from '@/components/manage/content/Collect'
import History from '@/components/manage/content/History'
import Upload from '@/components/manage/content/Upload';
import User from '@/components/manage/content/User'
import Carousel from '@/components/manage/content/Carousel'
import Recommend from '@/components/manage/content/Recommend'
import Apply from '@/components/manage/content/Apply'

Vue.use(Router)

export default new Router({
  mode: 'history', //去掉url中的#
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },{
      path: '/index',
      name: 'Index',
      component: Index
    },{
      path: '/search/:id/:keyword',
      name: 'Search',
      component: Search
    },{
      path: '/detail/:id',
      name: 'Detail',
      component: Detail
    },{
      path: '/read/:id',
      name: 'Read',
      component: Read
    },{
      path: '/comment',
      name: 'Comment',
      component: Comment
    },{
      path: '/manage',
      name: 'Manage',
      component: Manage,
      children: [{
          path: "profile",
          component: Profile
        },{
          path: "collect",
          component: Collect
        },{
          path: "history",
          component: History
        }, {
          path: "upload",
          component: Upload
        },{
          path: "user",
          component: User
        }, {
          path: "carousel",
          component: Carousel
        }, {
          path: "recommend",
          component: Recommend
        },{
          path: "apply",
          component: Apply
        }
      ]
    }
  ]
})
